package com.giscloud.amp.dao;

import com.giscloud.amp.entity.AmpStaffAuth;
import com.giscloud.amp.entity.AmpStaffAuthExample;
import com.giscloud.amp.entity.dto.AmpStaffAuthDTO;
import com.giscloud.amp.entity.vo.AmpStaffAuthVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface AmpStaffAuthMapper {
    long countByExample(AmpStaffAuthExample example);

    int deleteByExample(AmpStaffAuthExample example);

    int insert(AmpStaffAuth record);

    int insertSelective(AmpStaffAuth record);

    List<AmpStaffAuthVO> selectByExample(AmpStaffAuthExample example);

    List<AmpStaffAuthVO> selectStaffAuthByDTO(AmpStaffAuthDTO ampStaffAuthDTO);

    List<AmpStaffAuthVO> findStaffAuthByExample(@Param("record") AmpStaffAuth auth, @Param("example") AmpStaffAuthExample example);

    List<AmpStaffAuthVO> findStaffAuthByExampleOther(@Param("record") AmpStaffAuth auth, @Param("example") AmpStaffAuthExample example);
    List<AmpStaffAuthVO> findStaffAuthByExample4Admin(@Param("record") AmpStaffAuth auth, @Param("example") AmpStaffAuthExample example);

    List<AmpStaffAuthVO> findRoleAuthByExample(@Param("record") AmpStaffAuth auth, @Param("example") AmpStaffAuthExample example);

    int updateByExampleSelective(@Param("record") AmpStaffAuth record, @Param("example") AmpStaffAuthExample example);

    int updateByExample(@Param("record") AmpStaffAuth record, @Param("example") AmpStaffAuthExample example);

    List<AmpStaffAuthVO> findAuthByStaffAndRole(@Param("staffId") Long staffId, @Param("roleIds") List<Long> roleIds);

    List<AmpStaffAuthVO> findAuthByAuthId(@Param("authType") String authType, @Param("authList") List<AmpStaffAuthVO> authList, @Param("systemId") Long systemId);

    int batchInsert(List<AmpStaffAuthDTO> list);

    /**
     * 批量更新
     * @param list
     * @return
     */
    int batchUpdate(List<AmpStaffAuthDTO> list);
}